import { isArray, map, includes, each, difference } from "lodash";
import React, { useMemo } from "react";
import { Section, Input, Checkbox, Select } from "@/components/visualizations/editor";
import { UpdateOptionsStrategy } from "@/components/visualizations/editor/createTabbedEditor";
import { EditorPropTypes } from "@/visualizations/prop-types";

export default function GeneralSettings({ options, data, visualizationName, onOptionsChange }) {
  return (
    <React.Fragment>
{/*       <Section>
        <Checkbox
          data-test="Chart.DataLabels.ExportExcel"
          defaultChecked={options.exportExcel}
          onChange={event => onOptionsChange({ exportExcel: event.target.checked })}>
          输出Excel
        </Checkbox>
        <Checkbox
          data-test="Chart.DataLabels.ExportWord"
          defaultChecked={options.exportWord}
          onChange={event => onOptionsChange({ exportWord: event.target.checked })}>
          输出Word
        </Checkbox>
        <Checkbox
          data-test="Chart.DataLabels.ExportPDF"
          defaultChecked={options.exportPDF}
          onChange={event => onOptionsChange({ exportPDF: event.target.checked })}>
          输出PDF
        </Checkbox>
        <Checkbox
          data-test="Chart.DataLabels.ExportPPT"
          defaultChecked={options.exportPPT}
          onChange={event => onOptionsChange({ exportPPT: event.target.checked })}>
          输出PPT
        </Checkbox>
      </Section>
*/}
      <Section>
        <Checkbox
          data-test="Chart.DataLabels.ImportExcel"
          defaultChecked={options.importExcel}
          onChange={event => onOptionsChange({ importExcel: event.target.checked })}>
          Excel导入
        </Checkbox>
        <Input
          label="成功提示信息"
          value={options.importExcelSuccessInfo}
          disabled={!options.importExcel}
          onChange={e => onOptionsChange({ importExcelSuccessInfo: e.target.value })}
          placeholder="提示信息"
        />
        <Input
          label="操作对应存储过程"
          value={options.importExcelSql}
          disabled={!options.importExcel}
          onChange={e => onOptionsChange({ importExcelSql: e.target.value })}
          placeholder="存储过程"
        />
      </Section>
      <Section>
        <Checkbox
          data-test="Chart.DataLabels.Do"
          defaultChecked={options.do}
          onChange={event => onOptionsChange({ do: event.target.checked })}>
          操作
        </Checkbox>
        <Input
          value={options.doTitle}
          disabled={!options.do}
          onChange={e => onOptionsChange({ doTitle: e.target.value })}
          placeholder="操作名称"
        />
        <Input
          label="成功提示信息"
          value={options.doSuccessInfo}
          disabled={!options.do}
          onChange={e => onOptionsChange({ doSuccessInfo: e.target.value })}
          placeholder="提示信息"
        />
        <Input
          label="操作对应存储过程"
          value={options.doSql}
          disabled={!options.do}
          onChange={e => onOptionsChange({ doSql: e.target.value })}
          placeholder="存储过程"
        />
      </Section>
    </React.Fragment>
  );
}

GeneralSettings.propTypes = EditorPropTypes;
